<template>
  <div class="app-container">
    <el-row :gutter="15">
      <el-col :span="24">
        <el-card shadow="always" style="background-color: #E9F0F8; margin-bottom: 10px; color: #5F71DF">
          {{ application.name }}
          <el-tag size="mini" v-for="atype in dict.type.application_type" :key="atype.id"
                  v-if="application.type == atype.value">{{ atype.label }}
          </el-tag>
          <span class="description"> {{ application.description }}</span>
        </el-card>
      </el-col>
    </el-row>
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
      <el-form-item label="页面名称" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入页面名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="queryParams.status" placeholder="页面状态" clearable>
          <el-option
            v-for="dict in dict.type.status"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPerm="['pageInfo_add']"
        >新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="info"
          plain
          icon="el-icon-sort"
          size="mini"
          @click="toggleExpandAll"
        >展开/折叠
        </el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table
      border
      v-if="refreshTable"
      v-loading="loading"
      :data="pageInfoList"
      row-key="id"
      :default-expand-all="isExpandAll"
      :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
    >
      <el-table-column prop="name" label="页面名称"></el-table-column>
      <el-table-column prop="status" label="类型">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.page_type" :value="scope.row.type"/>
        </template>
      </el-table-column>
      <el-table-column prop="sort" label="排序"></el-table-column>
      <el-table-column label="版本号">
        <template slot-scope="scope">
          <span>{{ scope.row.version }}</span>
        </template>
      </el-table-column>
      <el-table-column prop="status" label="状态">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.status" :value="scope.row.status"/>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createTime">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime) }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="260">
        <template slot-scope="scope">
          <el-button
            v-if="scope.row.type != '0'"
            size="mini"
            type="text"
            icon="el-icon-sugar"
            @click="handleDesign(scope.row)"
            v-hasPerm="['application_edit']"
          >设计
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handlePreview(scope.row)"
            v-hasPerm="['pageInfo_edit']"
          >预览
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPerm="['pageInfo_edit']"
          >修改
          </el-button>
          <el-button
            v-if="scope.row.type == '0'"
            size="mini"
            type="text"
            icon="el-icon-plus"
            @click="handleAdd(scope.row)"
            v-hasPerm="['pageInfo_add']"
          >新增
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPerm="['pageInfo_del']"
          >删除
          </el-button>
          <el-button
            v-if="scope.row.type != '0'"
            size="mini"
            type="text"
            icon="el-icon-sort"
            @click="handleVersion(scope.row)">
            版本
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <!-- 添加或修改页面对话框 -->
    <h5ve-dialog :title="title" :show.sync="open" :width="800" append-to-body :isFooter="true">
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
        <el-row>
          <el-col :span="24">
            <el-form-item label="上级页面" prop="parentId">
              <treeselect v-model="form.parentId" :options="pageInfoOptions" :normalizer="normalizer"
                          :defaultExpandLevel="2"
                          placeholder="选择上级页面"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="页面名称" prop="name">
              <el-input @input="inputName" v-model="form.name" placeholder="请输入页面名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="页面类型">
              <el-select v-model="form.type" placeholder="请选择页面类型">
                <el-option
                  v-for="dict in dict.type.page_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col v-if="form.type != '0'" :span="12">
            <el-form-item label="表名" prop="tableName">
              <el-input
                :readonly="Boolean(form.id)"
                v-model.lazy="form.tableName"
                placeholder="请输入表名">
                <template slot="prepend">form_</template>
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item prop="menuId">
            <span slot="label">父级菜单
              <el-tooltip content="菜单生成的上级菜单" placement="top">
                <i class="el-icon-question"></i>
              </el-tooltip>
            </span>
              <treeselect v-model="form.menuId" :options="menus" :normalizer="normalizer"
                          placeholder="选择父级菜单"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="显示排序" prop="sort">
              <el-input-number v-model="form.sort" controls-position="right" :min="0"/>
            </el-form-item>
          </el-col>
          <el-col v-if="form.id" :span="12">
            <el-form-item label="状态">
              <el-radio-group v-model="form.status">
                <el-radio
                  v-for="dict in dict.type.status"
                  :key="dict.value"
                  :label="dict.value"
                >{{ dict.label }}
                </el-radio>
              </el-radio-group>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="备注" prop="remarks">
              <el-input type="textarea" v-model="form.remarks" rows="6" placeholder="请输入备注"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm(false)">确 定</el-button>
        <el-button v-if="form.type != '0'" type="success" @click="submitForm(true)">确定并设计</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </h5ve-dialog>

    <!--表单设计-->
    <el-dialog
      :close-on-press-escape="false"
      :visible.sync="visible"
      :destroy-on-close="true"
      :show-close="false"
      class="fullscreen-dialog"
      :fullscreen="true">
      <div class="form-design-header">
        <ul>
          <li v-for="(item, index) in menuList"
              @click="changeCarousel(item)"
              :key="'menuList.' + index"
              :class="{'active-carousel':  current === index}">
            <label>
              <span>
                <span class="icon" :class="item.icon"></span>
                <span>{{ item.name }}</span>
              </span>
            </label>
            <span
              v-show="(index + 1) !== menuList.length"
              class="el-icon-arrow-right">
            </span>
          </li>
        </ul>
        <ul class="center-ul">
          <el-button-group>
            <el-button
              size="small"
              :disabled="current === 0"
              @click="changeCarousel('prev')"
              icon="el-icon-arrow-left">
              上一步
            </el-button>
            <el-button
              size="small"
              :disabled="current === menuList.length - 1"
              @click="changeCarousel('next')">下一步
              <i class="el-icon-arrow-right"></i>
            </el-button>
          </el-button-group>
        </ul>
        <ul class="right-ul">
          <el-button-group>
            <el-button
              size="small"
              @click="closeFormDesign"
              icon="el-icon-circle-close">
              关闭
            </el-button>
            <el-button
              :loading="dloading"
              @click="submitFormDesign"
              size="small">提交
              <i class="el-icon-circle-check"></i>
            </el-button>
          </el-button-group>
        </ul>
      </div>
      <el-carousel
        ref="carousel"
        arrow="never"
        :autoplay="false"
        indicator-position="none"
        height="calc(100vh - 65px)"
        @change="current = $event">
        <el-carousel-item
          v-for="(plugin, index) in menuList"
          :key="'menuList.' + index"
          :name="plugin.carousel">
          <component v-if="visible" :info="form" :ref="plugin.carousel" :is="plugin.carousel"/>
        </el-carousel-item>
      </el-carousel>
    </el-dialog>

    <!--表单版本控制-->
    <el-dialog
      append-to-body
      :show-close="false"
      class="fullscreen-dialog"
      :visible.sync="version.visible"
      :fullscreen="true">
      <div style="padding: 5px;">
        <el-page-header
          style="margin-bottom: 10px;"
          @back="version.visible = false"
          content="版本控制"/>
        <el-table
          border
          :data="version.list"
          v-loading="version.loading"
          :height="version.list.length ? 'calc(100vh - 130px)' : '200px'">
          <el-table-column label="主键" width="60" align="center" prop="id"/>
          <el-table-column label="表单名称" align="center" prop="name"/>
          <el-table-column label="表单标识" align="center">
            <template slot-scope="scope">
              <el-popover trigger="hover" placement="top">
                <span>{{ scope.row.code }}</span>
                <div slot="reference">
                  <span class="text-nowrap">{{ scope.row.code }}</span>
                </div>
              </el-popover>
            </template>
          </el-table-column>
          <!--          <el-table-column label="表单结构" align="center" prop="type" :formatter="formatTableValue"/>-->
          <el-table-column label="表名" align="center" prop="tableName"/>
          <!--          <el-table-column label="自动建表" align="center" prop="autoCreate" :formatter="formatTableValue"/>-->
          <el-table-column label="版本号" align="center" prop="version">
            <template slot-scope="scope">
              <span>{{ scope.row.version }}</span>
            </template>
          </el-table-column>
          <el-table-column label="版本" align="center" prop="isMain">
            <template slot-scope="scope">
              <span style="color: #1890ff;" v-show="Number(scope.row.isMain)">主版本</span>
              <span style="color:#aaa;" v-show="!Number(scope.row.isMain)">非主版本</span>
            </template>
          </el-table-column>
          <!--          <el-table-column label="状态" align="center" prop="status" :formatter="formatTableValue"/>-->
          <el-table-column
            fixed="right"
            width="270"
            label="操作"
            align="center">
            <template slot-scope="scope">
              <el-button
                size="mini"
                :disabled="scope.row.isMain == 1"
                type="text"
                icon="el-icon-house"
                @click="setFormMain(scope.row)"
                v-hasPerm="['form_edit']">
                设置为主版本
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPerm="['form_edit']">
                修改
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPerm="['form_del']">
                删除
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <pagination
          :total="version.total"
          :page.sync="version.current"
          :limit.sync="version.size"
          @pagination="getVersionList"
        />
      </div>
    </el-dialog>

  </div>
</template>

<script>
import {
  listPageInfo,
  getPageInfo,
  delPageInfo,
  addPageInfo,
  editPageInfo,
  treePageInfo,
  getMenuTree,
  checkName,
  setMain,
  listPageInfoExcludeChild
} from "@/api/toolkit/pageInfo";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getApplication} from "@/api/toolkit/application";
import baseInfo from "./base-info";
import formDesign from "./form-design";
import fieldInfo from "./field-info";
import formFlow from "./form-flow";
import formConfig from "./form-config";
import {getLetterByStr} from "@/utils/h5ve";
import {logicFlowJsonToFlowXml, logicFlowJsonToWarmFlow} from "@/components/WarmFlow/js/tool";
import {saveXml} from "@/api/flow/definition";

export default {
  name: "PageInfo",
  dicts: ['application_type', 'page_type', 'status'],
  components: {
    Treeselect,
    baseInfo,
    formDesign,
    fieldInfo,
    formFlow,
    formConfig
  },
  data() {
    const validate = (rule, value, callback) => {
      if (!value) {
        callback(new Error('表单名称必填！'));
      } else {
        if (this.nameStatus === 0) {
          callback(new Error('正在校验表单名称！'));
        } else if (this.nameStatus === 1) {
          callback(new Error('已存在该表单名称！'));
        } else {
          callback();
        }
      }
    }
    return {
      // 遮罩层
      loading: true,
      // 显示搜索条件
      showSearch: true,
      // 表格树数据
      pageInfoList: [],
      // 页面树选项
      pageInfoOptions: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 是否展开，默认全部展开
      isExpandAll: true,
      // 重新渲染表格状态
      refreshTable: true,
      // 查询参数
      queryParams: {
        applicationId: undefined,
        name: undefined,
        status: undefined
      },
      application: {
        id: null,
        name: undefined,
        type: undefined,
        industry: undefined,
        cover: undefined,
        version: "1.0.0",
        description: undefined
      },
      menus: [],
      infoProps: {
        value: 'id',
        label: 'name',
        children: 'children'
      },
      dloading: false,
      current: 0,
      menuList: [],
      visible: false,
      nameStatus: 2,
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        parentId: [
          {required: true, message: "上级页面不能为空", trigger: "blur"}
        ],
        name: [
          {required: true, message: "页面名称不能为空", trigger: "blur"}
        ],
        sort: [
          {required: true, message: "显示排序不能为空", trigger: "blur"}
        ],
        email: [
          {
            type: "email",
            message: "请输入正确的邮箱地址",
            trigger: ["blur", "change"]
          }
        ],
        phone: [
          {
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
            message: "请输入正确的手机号码",
            trigger: "blur"
          }
        ]
      },
      version: {
        code: "",
        list: [],
        total: 0,
        size: 20,
        current: 1,
        loading: false,
        visible: false,
      }
    };
  },
  created() {
    const appId = this.$route.params && this.$route.params.appId;
    if (appId) {
      this.queryParams.applicationId = appId
      // this.search.data.applicationId = appId;
      // this.getTreeList(appId);
      getApplication(appId).then(response => {
        this.application = response.data;
      });
    }
    this.getList();
    this.getMenuTreeData();
  },
  methods: {
    inputName(data) {
      if (data && !this.form.id) {
        this.nameStatus = 0;
        checkName(data).then(response => {
          const {code} = response;
          if (code) {
            this.nameStatus = 1;
          } else {
            this.nameStatus = 2;
          }
        }).catch(() => {
          this.nameStatus = 1;
        })
        if (!this.form.id) {
          this.form.tableName = getLetterByStr(data);
        }
      } else {
        this.nameStatus = 2;
      }
    },
    /** 查询页面列表 */
    getList() {
      this.loading = true;
      listPageInfo(this.queryParams).then(response => {
        this.pageInfoList = this.handleTree(response.data, "id");
        this.loading = false;
      });
    },
    getPageInfoTree(menuName) {
      treePageInfo({applicationId: this.application.id, name: menuName}).then(response => {
        console.log(response)
        this.pageInfoOptions = this.handleTree(response.data, "id");
        this.form.menuId = response.msg;
      });
    },
    /**获取菜单树*/
    getMenuTreeData() {
      getMenuTree().then(res => {
        this.menus = this.handleTree(res.data, "id");
      })
    },
    /** 转换页面数据结构 */
    normalizer(node) {
      if (node.children && !node.children.length) {
        delete node.children;
      }
      return {
        id: node.id,
        label: node.name,
        children: node.children
      };
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: undefined,
        parentId: undefined,
        applicationId: null,
        name: undefined,
        code: "",
        type: '0',
        tableName: "",
        sort: 1,
        menuId: "",
        status: "0",
        remarks: ""
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd(row) {
      this.reset();
      this.getPageInfoTree(this.application.name);
      if (row != undefined) {
        this.form.parentId = row.id;
      }
      this.form.applicationId = this.application.id;
      this.open = true;
      this.title = "添加页面";

    },
    /** 展开/折叠操作 */
    toggleExpandAll() {
      this.refreshTable = false;
      this.isExpandAll = !this.isExpandAll;
      this.$nextTick(() => {
        this.refreshTable = true;
      });
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.getPageInfoTree(row.name);
      getPageInfo(row.id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改页面";
      });
    },
    /** 提交按钮 */
    submitForm(flag) {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != undefined) {
            editPageInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
              if (flag) {
                this.handleDesign(this.form)
              }
            });
          } else {
            addPageInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
              if (flag) {
                this.handleDesign(response.data)
              }
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      this.$modal.confirm('是否确认删除名称为"' + row.name + '"的数据项？').then(function () {
        return delPageInfo(row.id);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    handleDesign(row) {
      this.current = 0
      getPageInfo(row.id).then(response => {
        this.form = response.data;
        this.visible = true;
        //加载菜单
        if (row.type == '1') {//普通表单
          this.menuList = [{
            icon: "el-icon-cpu",
            name: "表单设计",
            carousel: "formDesign"
          }, {
            icon: "el-icon-coin",
            name: "字段信息",
            carousel: "fieldInfo",
          }]
        } else if (row.type == '2') {//流程表单
          this.menuList = [{
            icon: "el-icon-cpu",
            name: "表单设计",
            carousel: "formDesign"
          }, {
            icon: "el-icon-coin",
            name: "字段信息",
            carousel: "fieldInfo",
          }, {
            icon: "el-icon-news",
            name: "流程设计",
            carousel: "formFlow"
          }]
        }
      });
    },
    /**关闭表单设计*/
    closeFormDesign() {
      this.$confirm('确定关闭表单设计吗？关闭后不会保留或更改表单设计内容！', '系统提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.visible = false;
      })
    },
    /**关闭表单设计*/
    closeModelDesign() {
      this.model.visible = false;
    },
    handlePreview(row) {
      this.$tab.openPage(row.name, "/myform/generate/" + row.code)
    },
    /**保存表单设计*/
    submitFormDesign() {
      this.dloading = true;
      for (let i = 0; i < this.menuList.length; i++) {
        const item = this.menuList[i];
        const {carousel, ref, name} = item;
        const plugin = this.$refs[carousel][0];
        if (ref) {
          let validFlag = false;
          plugin.$refs[ref].validate(valid => {
            validFlag = valid;
          })
          if (!validFlag) {
            this.dloading = false;
            return this.$notify.warning(`【${name}】数据验证不通过`);
          }
        } else if (carousel === "formDesign") {
          const jsonStr = plugin.$refs[carousel].getWidgetFormJson();
          console.log(jsonStr)
          const {column} = JSON.parse(jsonStr);
          if (!column.length) {
            this.dloading = false;
            return this.$notify.warning(`【${name}】至少选择一个字段`);
          }
        }else if (carousel === "formFlow") {
          console.log(plugin.$refs[carousel])
          const graphData = plugin.$refs[carousel].lf.getGraphData()
          plugin.$refs[carousel].value['nodes'] = graphData['nodes']
          plugin.$refs[carousel].value['edges'] = graphData['edges']
          plugin.$refs[carousel].value['id'] = this.form.code
          let jsonString = logicFlowJsonToWarmFlow(plugin.$refs[carousel].value);
          console.log(jsonString)
          this.form.flowData = jsonString;
        }
      }
      this.$modal.loading("正在保存");
      if (this.form.pageData) {
        this.form.pageData = JSON.stringify(this.form.pageData)
      }
      console.log(this.form)
      if (this.form.id) {
        editPageInfo(this.form).then(response => {
          if (response) {
            this.$modal.closeLoading();
            this.dloading = false;
            this.visible = false;
            this.$notify.success("已更新");
            this.getList();
          }
        }).catch(() => {
          this.dloading = false;
          this.$modal.closeLoading();
        })
      } else {
        addPageInfo(this.form).then(response => {
          if (response) {
            this.$notify.success("已保存");
            this.$modal.closeLoading();
            this.dloading = false;
            this.visible = false;
            this.$alert('刷新页面即可开始体验', '提示', {
              confirmButtonText: '知道了'
            });
            this.getList();
          }
        }).catch(() => {
          this.dloading = false;
          this.$modal.closeLoading();
        })
      }
    },
    /**改变表单设计步骤*/
    changeCarousel(data) {
      const index = this.current;
      const {carousel, ref, name} = this.menuList[index];
      const plugin = this.$refs[carousel][0];
      if (ref) {
        let validFlag = false;
        plugin.$refs[ref].validate(valid => {
          validFlag = valid;
        })
        if (!validFlag) {
          return this.$notify.warning(`【${name}】数据验证不通过`);
        }
      } else if (carousel === "formDesign") {
        const jsonStr = plugin.$refs[carousel].getWidgetFormJson();
        this.form.pageData = JSON.parse(jsonStr);
        console.log(this.form.pageData)
        if (!this.form.pageData || (this.form.pageData && (!this.form.pageData.column || (this.form.pageData.column && !this.form.pageData.column.length)))) {
          return this.$notify.warning(`【${name}】至少选择一个字段`);
        }
      }
      if (data === 'prev') {
        this.$refs.carousel.prev();
      } else if (data === 'next') {
        this.$refs.carousel.next();
      } else if (data.carousel) {
        this.$refs.carousel.setActiveItem(data.carousel);
      }
    },
    handleVersion(data) {
      this.version.code = data.code;
      this.version.visible = true;
      this.getVersionList();
    },
    /**设置主版本*/
    setFormMain(data) {
      const row = JSON.parse(JSON.stringify(data));
      setMain(row).then(response => {
        if (response) {
          this.getVersionList();
          this.getList();
          this.$notify.success("设置成功");
        }
      })
    },
    /**获取表单版本列表*/
    getVersionList() {
      this.version.loading = true;
      listPageInfo({
        current: this.version.current,
        size: this.version.size,
        code: this.version.code
      }).then(response => {
        const {data, total} = response;
        this.version.list = data;
        this.version.total = total;
        this.version.loading = false;
      });
    },
  }
};
</script>
<style lang="scss" scoped>
::v-deep .el-card__body {
  padding: 10px;
}

::v-deep .is-fullscreen {
  .el-dialog__header {
    padding: 0;
  }

  .el-dialog__body {
    padding: 10px;
  }
}


.form-design-header {
  position: relative;
  height: 45px;
  border-bottom: 1px solid #f0f0f0;

  ul {
    margin: 0;

    li {
      line-height: 45px;
      list-style: none;
      float: left;

      .el-icon-arrow-right {
        padding: 0 16px;
        font-weight: 700;
      }

      .icon {
        padding-right: 5px;
      }

      &:hover {
        font-weight: 700;
        transition: .3s;
        color: #409eff;
      }
    }

    .active-carousel {
      color: #409eff;
    }
  }

  .center-ul {
    position: absolute;
    left: 50%;
    top: 6px;
  }

  .right-ul {
    position: absolute;
    top: 6px;
    right: 20px;
  }
}
</style>
